
import Layout from '@/layout/index.vue'

/*动态路由基于用户权限进行加载*/
export const asnycRouters = [
  {
    path: '/system/user-auth',
    component: Layout,
    hidden: true,
    permissions: ['system:user:edit'],
    children: [
      {
        path: 'role/:userId(\\d+)',
        component: () => import('@/views/system/user/authRole.vue'),
        name: 'AuthRole',
        meta: { title: '分配角色', activeMenu: '/system/user', keepAlive: true },
      },
    ],
  },
  {
    path: '/system/role-auth',
    component: Layout,
    hidden: true,
    permissions: ['system:role:edit'],
    children: [
      {
        path: 'user/:roleId(\\d+)',
        component: () => import('@/views/system/role/authUser.vue'),
        name: 'AuthUser',
        meta: { title: '分配用户', activeMenu: '/system/role' },
      },
    ],
  },
  {
    path: '/system/dict-data',
    component: Layout,
    hidden: true,
    permissions: ['system:dict:list'],
    children: [
      {
        path: 'index/:dictId(\\d+)',
        component: () => import('@/views/system/dict/dictData.vue'),
        name: 'Data',
        meta: { title: '字典数据', activeMenu: '/system/dict' },
      },
    ],
  },
  {
    path: '/monitor/job-log',
    component: Layout,
    hidden: true,
    permissions: ['monitor:job:list'],
    children: [
      {
        path: 'index/:jobId(\\d+)',
        component: () => import('@/views/monitor/job/log.vue'),
        name: 'JobLog',
        meta: { title: '调度日志', activeMenu: '/monitor/job' },
      },
    ],
  },
  {
    path: '/peasants/pea-message/add',
    component: Layout,
    hidden: true,
    permissions: ['cre:pea:add'],
    children: [
      {
        path: 'index/:hzId(\\d+)',
        component: () => import('@/views/credit/peasants/pea-message/add'),
        name: 'AddPea',
        meta: { title: '新增农户', activeMenu: '/peasants/pea-message', keepAlive: true},
      },
    ],
  },
  {
    path: '/peasants/pea-message/edit',
    component: Layout,
    hidden: true,
    permissions: ['cre:pea:edit'],
    children: [
      {
        path: 'index/:hzId(\\d+)',
        component: () => import('@/views/credit/peasants/pea-message/add'),
        name: 'EditPea',
        meta: { title: '修改农户', activeMenu: '/peasants/pea-message', keepAlive: true},
      },
    ],
  },
  {
    path: '/gather/user-group',
    component: Layout,
    hidden: true,
    permissions: ['gather:group:edit'], // 修改小组信息
    children: [
      {
        path: 'group/:groupId(\\d+)',
        component: () => import('@/views/system/group/userGroup.vue'),
        name: 'UserGroup',
        meta: { title: '分配小组成员', activeMenu: '/system/group', keepAlive: true},
      },
    ],
  },
]
